Imports Microsoft.VisualBasic

Public Class cmsPageBase
    Inherits System.Web.UI.Page

    Private Sub Page_Load(ByVal sender As Object, _
            ByVal e As System.EventArgs) Handles Me.Load

        Dim pv As New PageView

        If Not pv.UserName Is Nothing Then

            Dim defaultview As String = "showLive();"

            If Request.Params.Get("__EVENTARGUMENT") = "mode=staged" Then
                defaultview = "showStaged();"
            End If

            Dim reader As New System.IO.StreamReader(Server.MapPath("~/atomcontrols/script_css_links.txt"))
            Dim jsblock As String = reader.ReadToEnd()
            jsblock = jsblock.Replace("%DEFAULT_VIEW%", defaultview)

            ClientScript.RegisterClientScriptBlock(GetType(System.String), "", jsblock, False)
            reader.Close()

        End If

    End Sub

End Class
